package textTests;
import globalCode.UserConnection;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;



public class TestTwo {

	public static void main(String[] args) {
		new TestTwo();
	}
	
	
	
	public TestTwo(){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String input = null;
	    System.out.println("Enter two user ids seperated by a space:");
	    try {
	       input = br.readLine();
	    } catch (IOException ioe) {
	       System.out.println("IO error!");
	       System.exit(1);
	    }
	    String[] inputStrs = input.split(" ");
	    int user1 = Integer.parseInt(inputStrs[0]);
	    int user2 = Integer.parseInt(inputStrs[1]);
	    
	    try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	    
	    //String url = "jdbc:mysql://ischooldev.fcps.net";
	    //String url = "jdbc:mysql://dosshome.dyndns-office.com:63306";
	    String url = "jdbc:mysql://192.168.1.33:3306";
		String username = "root";
		String password = "PAss33word!!";
		Connection con = null;
		
		try {
			con = DriverManager.getConnection(url, username, password);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		UserConnection uc = new UserConnection(user1, user2, con);
		System.out.println(uc);
		
	}

}
